/**
 * Copyright  (c) 2009-2013 XLab,  Org. 
 * All  rights  reserved. 
 */
package org.xlab.baseframework.domain.view;

import java.text.SimpleDateFormat;

import org.xlab.baseframework.domain.SystemCode;
import org.xlab.baseframework.domain.SystemLog;
import org.xlab.baseframework.domain.enumerate.EnumLogLevel;
import org.xlab.baseframework.system.Declare;

/**
 * <p>
 * 系统日志实体的只读实体
 * </p>
 * 
 * @author MaKuBEX Email:makubexnet@gmail.com
 * @version 1.0.0 Sep 7, 2010
 * @since 1.0.0
 * 
 */
public class SystemLogVO extends
		AbstractNormalVersionControlViewObject<SystemLog> {

	/**
	 * @serialField
	 */
	private static final long serialVersionUID = 4820008246891318437L;

	public static final String FIELD_ID = "id";
	public static final String FIELD_TITLE = "title";
	public static final String FIELD_CONTENT = "content";
	public static final String FIELD_CREATED_BY = "createdBy";
	public static final String FIELD_CREATED_TIME = "createdTime";
	public static final String FIELD_LOGLEVEL = "logLevel";
	public static final String FIELD_S_LOGLEVEL = "s_logLevel";
	public static final String FIELD_LOGTYPE = "logType";
	public static final String FIELD_S_LOGTYPE = "s_logType";

	private Long id;
	private String createdByName;
	private String lastUpdatedByName;
	private String title;
	private String content;
	private SystemCode logType;
	private EnumLogLevel logLevel;

	private String s_logType;
	private String s_logLevel;

	/**
	 * <p>
	 * 空构造函数
	 * </p>
	 */
	public SystemLogVO() {
		super();
	}

	/**
	 * <p>
	 * 默认构造函数
	 * </p>
	 * 
	 * @param pojo
	 *            系统日志实体
	 */
	public SystemLogVO(SystemLog pojo) {
		super(pojo);
		SimpleDateFormat sdf = new SimpleDateFormat(
				Declare.SYSTEM_LONG_DATE_FORMAT + Declare.SPACE
						+ Declare.SYSTEM_LONG_TIME_FORMAT);
		this.s_createdTime = sdf.format(pojo.getCreatedTime());
		this.s_lastUpdatedTime = sdf.format(pojo.getLastUpdatedTime());
		this.s_logType = this.logType.getDescription();
		this.s_logLevel = this.logLevel.getValue().toString();
	}

	/**
	 * @return the content
	 */
	public String getContent() {
		return content;
	}

	/**
	 * @return the createdByName
	 */
	public String getCreatedByName() {
		return createdByName;
	}

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @return the lastUpdatedByName
	 */
	public String getLastUpdatedByName() {
		return lastUpdatedByName;
	}

	/**
	 * @return the logLevel
	 */
	public EnumLogLevel getLogLevel() {
		return logLevel;
	}

	/**
	 * @return the logType
	 */
	public SystemCode getLogType() {
		return logType;
	}

	/**
	 * @return the title
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * @return the s_logType
	 */
	public String getS_logType() {
		return s_logType;
	}

	/**
	 * @return the s_logLevel
	 */
	public String getS_logLevel() {
		return s_logLevel;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @param createdByName the createdByName to set
	 */
	public void setCreatedByName(String createdByName) {
		this.createdByName = createdByName;
	}

	/**
	 * @param lastUpdatedByName the lastUpdatedByName to set
	 */
	public void setLastUpdatedByName(String lastUpdatedByName) {
		this.lastUpdatedByName = lastUpdatedByName;
	}

	/**
	 * @param title the title to set
	 */
	public void setTitle(String title) {
		this.title = title;
	}

	/**
	 * @param content the content to set
	 */
	public void setContent(String content) {
		this.content = content;
	}

	/**
	 * @param logType the logType to set
	 */
	public void setLogType(SystemCode logType) {
		this.logType = logType;
	}

	/**
	 * @param logLevel the logLevel to set
	 */
	public void setLogLevel(EnumLogLevel logLevel) {
		this.logLevel = logLevel;
	}

	/**
	 * @param s_logType the s_logType to set
	 */
	public void setS_logType(String s_logType) {
		this.s_logType = s_logType;
	}

	/**
	 * @param s_logLevel the s_logLevel to set
	 */
	public void setS_logLevel(String s_logLevel) {
		this.s_logLevel = s_logLevel;
	}

}
